package com.jeesite.modules.digitalize.constants;

import lombok.Getter;

import java.util.Arrays;

@Getter
public enum CompareStatusEnum {

    IN_PROCESS("0", "进行中"),
    SUCCESS("1", "成功");

    private final String code;
    private final String desc;

    CompareStatusEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static CompareStatusEnum getByCode(String code) {
        if (code != null) {
            return Arrays.stream(CompareStatusEnum.values()).filter(item -> item.code.equals(code)).findFirst().get();
        }
        return null;
    }
}